<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Alexa Auto SDK: com.amazon.aace.alexa.SpeechRecognizer Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="aace-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Alexa Auto SDK
   &#160;<span id="projectnumber">2.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>com</b></li><li class="navelem"><b>amazon</b></li><li class="navelem"><b>aace</b></li><li class="navelem"><b>alexa</b></li><li class="navelem"><a class="el" href="classcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer.html">SpeechRecognizer</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">com.amazon.aace.alexa.SpeechRecognizer Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="enumcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer_1_1_initiator.html">Initiator</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a70707cd51dffbbeeeb5e90ec5cb36b18"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer.html#a70707cd51dffbbeeeb5e90ec5cb36b18">wakewordDetected</a> (String wakeword)</td></tr>
<tr class="separator:a70707cd51dffbbeeeb5e90ec5cb36b18"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59f998dabf28a7db3d87e2b9350a221b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer.html#a59f998dabf28a7db3d87e2b9350a221b">endOfSpeechDetected</a> ()</td></tr>
<tr class="separator:a59f998dabf28a7db3d87e2b9350a221b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8abc634b08c0514cf66c65e7e4992058"><td class="memItemLeft" align="right" valign="top">final boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer.html#a8abc634b08c0514cf66c65e7e4992058">holdToTalk</a> ()</td></tr>
<tr class="separator:a8abc634b08c0514cf66c65e7e4992058"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ec1498c7b65fa48c095c153a6802cf1"><td class="memItemLeft" align="right" valign="top">final boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer.html#a4ec1498c7b65fa48c095c153a6802cf1">tapToTalk</a> ()</td></tr>
<tr class="separator:a4ec1498c7b65fa48c095c153a6802cf1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c85bfc150b64cc2389c4a036fa6c367"><td class="memItemLeft" align="right" valign="top">final boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer.html#a5c85bfc150b64cc2389c4a036fa6c367">startCapture</a> (<a class="el" href="enumcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer_1_1_initiator.html">Initiator</a> initiator, long keywordBegin, long keywordEnd, String keyword)</td></tr>
<tr class="separator:a5c85bfc150b64cc2389c4a036fa6c367"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c043bac65f630eed854a2e48182144c"><td class="memItemLeft" align="right" valign="top">final boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer.html#a9c043bac65f630eed854a2e48182144c">stopCapture</a> ()</td></tr>
<tr class="separator:a9c043bac65f630eed854a2e48182144c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0deee93d537185fac5422de414a38945"><td class="memItemLeft" align="right" valign="top">final boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer.html#a0deee93d537185fac5422de414a38945">enableWakewordDetection</a> ()</td></tr>
<tr class="separator:a0deee93d537185fac5422de414a38945"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf85cb08497b64f28dc95cabbd90ea52"><td class="memItemLeft" align="right" valign="top">final boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer.html#acf85cb08497b64f28dc95cabbd90ea52">disableWakewordDetection</a> ()</td></tr>
<tr class="separator:acf85cb08497b64f28dc95cabbd90ea52"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af0d4c212de01891b3647b2bf18a59df6"><td class="memItemLeft" align="right" valign="top">final boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer.html#af0d4c212de01891b3647b2bf18a59df6">isWakewordDetectionEnabled</a> ()</td></tr>
<tr class="separator:af0d4c212de01891b3647b2bf18a59df6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer.html">SpeechRecognizer</a> should be extended to initiate voice interactions with Alexa. <a class="el" href="classcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer.html">SpeechRecognizer</a> provides interfaces for</p>
<ul>
<li>Initiating a dialog interaction with Alexa via press-and-hold, press-and-release, and voice-initiated user actions</li>
</ul>
<ul>
<li>Enabling and disabling the wake word engine</li>
</ul>
<ul>
<li>Handling wake word and end of speech detection</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>For observing Alexa dialog state transitions, see <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1alexa_1_1_alexa_client.html#aa0c7e22aeb8007a30d02a0f89226886a">AlexaClient.dialogStateChanged()</a></code>. </dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a70707cd51dffbbeeeb5e90ec5cb36b18"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a70707cd51dffbbeeeb5e90ec5cb36b18">&#9670;&nbsp;</a></span>wakewordDetected()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean com.amazon.aace.alexa.SpeechRecognizer.wakewordDetected </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>wakeword</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the platform implementation when a wake word is detected</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wakeword</td><td>The wake word that was detected</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the Engine should initiate a recognize event, <code>false</code> if the Engine should ignore the invocation </dd></dl>

</div>
</div>
<a id="a59f998dabf28a7db3d87e2b9350a221b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a59f998dabf28a7db3d87e2b9350a221b">&#9670;&nbsp;</a></span>endOfSpeechDetected()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void com.amazon.aace.alexa.SpeechRecognizer.endOfSpeechDetected </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the platform implementation when end of speech is detected for the current recognize event </p>

</div>
</div>
<a id="a8abc634b08c0514cf66c65e7e4992058"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8abc634b08c0514cf66c65e7e4992058">&#9670;&nbsp;</a></span>holdToTalk()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">final boolean com.amazon.aace.alexa.SpeechRecognizer.holdToTalk </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the Engine of a speech recognition event initiated by a press-and-hold action on the platform. The Engine will call <code>startAudioInput()</code> to notify the platform implementation when to start writing audio samples. The platform implementation should call <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer.html#a9c043bac65f630eed854a2e48182144c">stopCapture()</a></code> to terminate speech recognition on release of the press-and-hold action.</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the Engine successfully initiated a recognize event, else <code>false</code> </dd></dl>

</div>
</div>
<a id="a4ec1498c7b65fa48c095c153a6802cf1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4ec1498c7b65fa48c095c153a6802cf1">&#9670;&nbsp;</a></span>tapToTalk()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">final boolean com.amazon.aace.alexa.SpeechRecognizer.tapToTalk </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the Engine of a speech recognition event initiated by a press-and-release action on the platform. The Engine will call <code>startAudioInput()</code> to notify the platform implementation when to start writing audio samples. The Engine will terminate the recognize event initiated by the press-and-release action when end of speech is detected.</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the Engine successfully started a recognize event, else <code>false</code> </dd></dl>

</div>
</div>
<a id="a5c85bfc150b64cc2389c4a036fa6c367"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5c85bfc150b64cc2389c4a036fa6c367">&#9670;&nbsp;</a></span>startCapture()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">final boolean com.amazon.aace.alexa.SpeechRecognizer.startCapture </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="enumcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer_1_1_initiator.html">Initiator</a>&#160;</td>
          <td class="paramname"><em>initiator</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>keywordBegin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>keywordEnd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>keyword</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the Engine of a speech recognition event. The Engine will call <code>startAudioInput()</code> to notify the platform implementation when to start writing audio samples. If the initator type is <code>HOLD_TO_TALK</code>, then the platform implementation should call <code><a class="el" href="classcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer.html#a9c043bac65f630eed854a2e48182144c">stopCapture()</a></code> to terminate speech recognition on release of the press-and-hold action. Otherwise, the Engine will terminate the recognize event when end of speech is detected.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">initiator</td><td>The <code><a class="el" href="enumcom_1_1amazon_1_1aace_1_1alexa_1_1_speech_recognizer_1_1_initiator.html">Initiator</a></code> type for the speech recognition event </td></tr>
    <tr><td class="paramname">keywordBegin</td><td>The sample index where the keyword begins. This is required when the initator type is <code>WAKEWORD</code>, otherwise should be set to <code>UNSPECIFIED_INDEX</code>. </td></tr>
    <tr><td class="paramname">keywordEnd</td><td>The sample index where the keyword ends. This is required when the initator type is <code>WAKEWORD</code>, otherwise should be set to <code>UNSPECIFIED_INDEX</code>. </td></tr>
    <tr><td class="paramname">keyword</td><td>The keyword being recognized, e.g. "alexa". This is required when the initator type is <code>WAKEWORD</code>, otherwise should be set to null. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the Engine successfully started a recognize event, else <code>false</code> </dd></dl>

</div>
</div>
<a id="a9c043bac65f630eed854a2e48182144c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9c043bac65f630eed854a2e48182144c">&#9670;&nbsp;</a></span>stopCapture()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">final boolean com.amazon.aace.alexa.SpeechRecognizer.stopCapture </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the Engine to terminate the current recognize event. The Engine will call <code>stopAudioInput()</code> to notify the platform implementation when to stop writing audio samples.</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the Engine successfully terminated the current recognize event, else <code>false</code> </dd></dl>

</div>
</div>
<a id="a0deee93d537185fac5422de414a38945"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0deee93d537185fac5422de414a38945">&#9670;&nbsp;</a></span>enableWakewordDetection()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">final boolean com.amazon.aace.alexa.SpeechRecognizer.enableWakewordDetection </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the Engine to enable the wake word engine. Wake word must be supported in the Engine to be enabled by this call.</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the Engine successfully enabled wake word detection, else <code>false</code> </dd></dl>

</div>
</div>
<a id="acf85cb08497b64f28dc95cabbd90ea52"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acf85cb08497b64f28dc95cabbd90ea52">&#9670;&nbsp;</a></span>disableWakewordDetection()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">final boolean com.amazon.aace.alexa.SpeechRecognizer.disableWakewordDetection </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Notifies the Engine to disable the wake word engine</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the Engine successfully disabled wakeword detection, else <code>false</code> </dd></dl>

</div>
</div>
<a id="af0d4c212de01891b3647b2bf18a59df6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af0d4c212de01891b3647b2bf18a59df6">&#9670;&nbsp;</a></span>isWakewordDetectionEnabled()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">final boolean com.amazon.aace.alexa.SpeechRecognizer.isWakewordDetectionEnabled </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Checks if wake word detection is enabled in the Engine</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if wake word detection is enabled, else <code>false</code> </dd></dl>

</div>
</div>
</div><!-- contents -->
<html>
  <body>
    <hr style="height:1px;border-width:0;color:gray;background-color:gray">
    <p style="text-align:left;">
      Alexa Auto SDK 2.2.0 - Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
      <span style="float:right;">
        Licensed under the <a HREF=http://aws.amazon.com/apache2.0/>Apache License, Version 2.0</a>
      </span>
    </p>
  </body>
</html>
